package xerr

import "github.com/zeromicro/x/errors"

func New(code int) error {
	if msg, ok := CodeMap[code]; ok {
		return errors.New(code, msg)
	}
	return errors.New(SystemError, CodeMap[SystemError])
}

func DBError() error {
	return errors.New(DataBaseError, CodeMap[DataBaseError])
}

func SysError() error {
	return errors.New(SystemError, CodeMap[SystemError])
}
